package cn.com.lms.business.examRewrite.service;

import cn.com.lms.business.examRewrite.persistence.entity.PaperQuestionReWrite;
import cn.com.lms.business.examRewrite.persistence.repository.PaperQuestionReWriteDao;
import com.bnzj.core.persistence.BaseService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PaperQuestionReWriteService extends BaseService<PaperQuestionReWriteDao, PaperQuestionReWrite,Long> {
    /**
     * 通过id和is_delete获取随机试卷的数据
     * @param id
     * @param is_delete
     * @return
     */
    public List<PaperQuestionReWrite> findByIdAndIsDelete(Long id, boolean is_delete) {
        return repository.findByIdAndIsDelete(id,is_delete);
    }

    public List<Map> findQuestionByPaperId(Long id) {
        return repository.findQuestionByPaperId(id);
    }

    /**
     * 通过PaperId删除
     * @param result
     * @param ids
     */
    public void deletePaperQuestionReWriteByPaperId(boolean result, List<Long> ids) {
        repository.deletePaperQuestionReWriteByPaperId(result,ids);
    }
}
